import request from '@/utils/request'

// 创建商品库存
export function createStock(data) {
  return request({
    url: '/stock/stock/create',
    method: 'post',
    data: data
  })
}

// 更新商品库存
export function updateStock(data) {
  return request({
    url: '/stock/stock/update',
    method: 'put',
    data: data
  })
}

// 删除商品库存
export function deleteStock(id) {
  return request({
    url: '/stock/stock/delete?id=' + id,
    method: 'delete'
  })
}

// 获得商品库存
export function getStock(id) {
  return request({
    url: '/stock/stock/get?id=' + id,
    method: 'get'
  })
}

// 获得商品库存分页
export function getStockPage(params) {
  return request({
    url: '/stock/stock/page',
    method: 'get',
    params
  })
}
// 导出商品库存 Excel
export function exportStockExcel(params) {
  return request({
    url: '/stock/stock/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}